From 7f1cb71544cfc158ee21c64af61d15563b01e76f Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 1 Mar 2007 10:01:51 +0000 Subject: [PATCH] Change compat-check in set_vcpucontext again. Give caller leeway for HVM guests only. Signed-off-by: Keir Fraser --- xen/arch/x86/domain.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index a1e0950270..7c75b49101 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -501,9 +501,12 @@ int arch_set_info_guest( unsigned long flags; int i, rc = 0, compat; - /* The context is a compat-mode one if the target domain is compat-mode; - * we expect the tools to DTRT even in compat-mode callers. */ - compat = IS_COMPAT(d); + /* + * HVM domain builder always builds caller-bitsize vcpu context. + * The PV builder is smarter and builds the appropriate type of context for + * the target domain. So the compat check here differs in the two cases. + */ + compat = is_hvm_domain(d) ? IS_COMPAT(current->domain) : IS_COMPAT(d); #ifdef CONFIG_COMPAT #define c(fld) (compat ? (c.cmp->fld) : (c.nat->fld)) -- 2.30.2